package com.demo.dao.impl;

import com.demo.dao.AccountDao;
import com.demo.pojo.Account;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository("accountDao")
public class AccountDaoImpl implements AccountDao {
    @Autowired
    JdbcTemplate jdbcTemplate;

    @Override
    public int update(Account account) {
        int result = jdbcTemplate.update("UPDATE `Account` SET `price` = ? WHERE `id` = ?", account.getPrice(), account.getId());
        return result;
    }
}
